package com.hexacta.hrs.web.struts.actions.feedbacks;

import java.util.List;

import com.hexacta.hrs.domain.feedback.FeedbackPeriodResumeByRole;
import com.hexacta.hrs.services.feedbacks.FeedbackPeriodService;
import com.opensymphony.xwork2.ActionSupport;

public class FeedbackControlPanelAction extends ActionSupport {

    private static final long serialVersionUID = -7192248251486130798L;
    
    private String period;
    
    private FeedbackPeriodService feedbackPeriodService;

    private List<FeedbackPeriodResumeByRole> feedbackPeriodsResumeByRoles;
    
    
    public String getPeriod() {
		return period;
	}

	public void setPeriod(String period) {
		this.period = period;
	}

	public FeedbackPeriodService getFeedbackPeriodService() {
        return feedbackPeriodService;
    }

    public void setFeedbackPeriodService(final FeedbackPeriodService feedbackPeriodService) {
        this.feedbackPeriodService = feedbackPeriodService;
    }

    public List<FeedbackPeriodResumeByRole> getFeedbackPeriodsResumeByRoles() {
        return feedbackPeriodsResumeByRoles;
    }

    public void setFeedbackPeriodsResumeByRoles(final List<FeedbackPeriodResumeByRole> feedbackPeriodsResumeByRoles) {
        this.feedbackPeriodsResumeByRoles = feedbackPeriodsResumeByRoles;
    }

    @Override
    public String execute() throws Exception {
        return SUCCESS;
    }

    public String listFeedbackPeriods() {
        feedbackPeriodsResumeByRoles = feedbackPeriodService.getAllFeedbackPeriodResumesByRole(getPeriod());
        return SUCCESS;
    }

}